// /common/http.api.js


// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {

	// 获取验证码
	let smsSend = (params = {}) => vm.$u.http.post('api/send/sms', params);
	//验证码登录
	let phone_smscode = (params = {}) => vm.$u.http.post('personal/login/phone_login', params);
	//首页
	let index = (params = {}) => vm.$u.http.post('personal/index/index ', params);
	//协议
	let protocol = (params = {}) => vm.$u.http.post('personal/index/protocol ', params);
	//昵称
	let set_nickname = (params = {}) => vm.$u.http.post('personal/index/set_nickname ', params);
	//提现
	let wallet = (params = {}) => vm.$u.http.post('personal/index/wallet', params);
	//提现记录
	let wallet_log = (params = {}) => vm.$u.http.post('personal/index/wallet_log', params);

	//抽佣
	let set_portion = (params = {}) => vm.$u.http.post('personal/index/set_portion', params);
	//达人订单
	let orderlist = (params = {}) => vm.$u.http.post('personal/order/list', params);
	//订单详情
	let detail = (params = {}) => vm.$u.http.post('personal/order/detail', params);
	//提现说明
	let article = (params = {}) => vm.$u.http.post('api/sys/article', params);
	
	//提现说明
	let ad = (params = {}) => vm.$u.http.post('api/sys/ad', params);

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.http.api(因为vm就是this，也即this.$u.http.api)下
	vm.$u.api = {
		orderlist,
		smsSend,
		phone_smscode,
		index,
		protocol,
		set_nickname,
		wallet,
		wallet_log,
		set_portion,
		article,
		detail,
		ad
	};
}

export default {
	install
}